﻿using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.Common;
using HumanManagement.BusinessObjects;
using HumanManagement.DataAccess;

namespace HumanManagement.BusinessLogic
{
	public class ForeignLanguageLevelBL
	{

		#region ***** Init Methods ***** 
		ForeignLanguageLevelDA objForeignLanguageLevelDA;
		public ForeignLanguageLevelBL()
		{
			objForeignLanguageLevelDA = new ForeignLanguageLevelDA();
		}
		#endregion

		#region ***** Get Methods ***** 
		/// <summary>
		/// Get ForeignLanguageLevel by id
		/// </summary>
		/// <param name="id">ID</param>
		/// <returns>ForeignLanguageLevel</returns>
		public ForeignLanguageLevel GetByID(int id)
		{
			return objForeignLanguageLevelDA.GetByID(id);
		}

		/// <summary>
		/// Get all of ForeignLanguageLevel
		/// </summary>
		/// <returns>List<<ForeignLanguageLevel>></returns>
		public List<ForeignLanguageLevel> GetList()
		{
			string cacheName = "lstForeignLanguageLevel";
			if( ServerCache.Get(cacheName) == null )
			{
				ServerCache.Insert(cacheName, objForeignLanguageLevelDA.GetList(), "ForeignLanguageLevel");
			}
			return (List<ForeignLanguageLevel>) ServerCache.Get(cacheName);
		}

		/// <summary>
		/// Get DataSet of ForeignLanguageLevel
		/// </summary>
		/// <returns>DataSet</returns>
		public DataSet GetDataSet()
		{
			string cacheName = "dsForeignLanguageLevel";
			if( ServerCache.Get(cacheName) == null )
			{
				ServerCache.Insert(cacheName, objForeignLanguageLevelDA.GetDataSet(), "ForeignLanguageLevel");
			}
			return (DataSet) ServerCache.Get(cacheName);
		}


		/// <summary>
		/// Get all of ForeignLanguageLevel paged
		/// </summary>
		/// <param name="recperpage">recperpage</param>
		/// <param name="pageindex">pageindex</param>
		/// <returns>List<<ForeignLanguageLevel>></returns>
		public List<ForeignLanguageLevel> GetListPaged(int recperpage, int pageindex)
		{
			return objForeignLanguageLevelDA.GetListPaged(recperpage, pageindex);
		}

		/// <summary>
		/// Get DataSet of ForeignLanguageLevel paged
		/// </summary>
		/// <param name="recperpage">recperpage</param>
		/// <param name="pageindex">pageindex</param>
		/// <returns>DataSet</returns>
		public DataSet GetDataSetPaged(int recperpage, int pageindex)
		{
			return objForeignLanguageLevelDA.GetDataSetPaged(recperpage, pageindex);
		}





		#endregion

		#region ***** Add Update Delete Methods ***** 
		/// <summary>
		/// Add a new ForeignLanguageLevel within ForeignLanguageLevel database table
		/// </summary>
		/// <param name="obj_foreignlanguagelevel">ForeignLanguageLevel</param>
		/// <returns>key of table</returns>
		public int Add(ForeignLanguageLevel obj_foreignlanguagelevel)
		{
			ServerCache.Remove("ForeignLanguageLevel", true);
			return objForeignLanguageLevelDA.Add(obj_foreignlanguagelevel);
		}

		/// <summary>
		/// updates the specified ForeignLanguageLevel
		/// </summary>
		/// <param name="obj_foreignlanguagelevel">ForeignLanguageLevel</param>
		/// <returns></returns>
		public void Update(ForeignLanguageLevel obj_foreignlanguagelevel)
		{
			ServerCache.Remove("ForeignLanguageLevel", true);
			objForeignLanguageLevelDA.Update(obj_foreignlanguagelevel);
		}

		/// <summary>
		/// Delete the specified ForeignLanguageLevel
		/// </summary>
		/// <param name="id">ID</param>
		/// <returns></returns>
		public void Delete(int id)
		{
			ServerCache.Remove("ForeignLanguageLevel", true);
			objForeignLanguageLevelDA.Delete(id);
		}
		#endregion
	}
}
